package com.cskaoyan.bean.vo;

import com.cskaoyan.bean.MarketAd;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author Fyy
 * @since 2022/12/29 09:53
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AdData {

    /**
     * deleted : null
     * addTime : 2022-12-29
     * name : kun
     * link : 123
     * startTime : null
     * updateTime : 2022-12-29
     * id : 5
     * position : 1
     * endTime : null
     * url : http://localhost:8083/pic/1e97bd20-5d55-41e2-9304-07bb6b6002fc-QQ图片20221209181318.jpg
     * content : 坤坤
     * enabled : true
     */
    private Date addTime;
    private String name;
    private String link;
    private Date updateTime;
    private int id;
    private int position;
    private String url;
    private String content;
    private boolean enabled;

    public static AdData data(MarketAd marketAd) {
        AdData data = new AdData();
        data.setAddTime(marketAd.getAddTime());
        data.setContent(marketAd.getContent());
        data.setEnabled(marketAd.getEnabled());
        data.setId(marketAd.getId());
        data.setLink(marketAd.getLink());
        data.setName(marketAd.getName());
        data.setPosition(marketAd.getPosition());
        data.setUpdateTime(marketAd.getUpdateTime());
        data.setUrl(marketAd.getUrl());
        return data;
    }
}
